/********************************************************************************
//               INTEL CORPORATION PROPRIETARY INFORMATION
//  This software is supplied under the terms of a license agreement or
//  nondisclosure agreement with Intel Corporation and may not be copied
//  or disclosed except in accordance with the terms of that agreement.
//        Copyright (c) 2000 Intel Corporation. All Rights Reserved.
//
//  VSS:
//      $Workfile: $
//      $Revision: $
//      $Date:     $
//      $Archive:  $
//
//  Description:
//      Intel(R) Integrated Performance Primitives Internal Common Definitions.
//
//  History:
//      Date          Author              Changes
//      2000/06/20    Patrick Xi          Created.
//      2001/02/12    Michael Zhang       Mapped return code to the uniformed naming.
********************************************************************************/


#ifndef ___IPPDEFS_H__
#define ___IPPDEFS_H__

#include "ippdefs.h"


/*******************************************************************************
//  Map internal status code (IPP_STATUS_CODE) to external (ippStsCode)
*******************************************************************************/
#define	IPP_STATUS_OK		ippStsNoErr	/* everything is okey         */
#define	IPP_STATUS_ERROR	ippStsErr	/* unknown/unspecified error  */
#define	IPP_STATUS_NO_MEM	ippStsNoMemErr	/* out of memory              */
#define	IPP_STATUS_BAD_ARG	ippStsBadArgErr	/* function arg/param is bad  */


#define IPPFUN(type, name)		extern type __STDCALL name

/*******************************************************************************
//  For sharing purpose some internal objects of IPP must be declared as extern
*******************************************************************************/

#define _IPPAPI(type, name, arg)	extern type __STDCALL name arg;
#define _IPPFUN(type, name)		extern type __STDCALL name

/*******************************************************************************
//  Symbol _IPP_VISIBLE controls the visibility of internal (static) functions
//  For testing purpose some internal objects of IPP may be declared as extern
//    _IPP_VISIBLE  undefined  -  static objects are invisible (default)
//    _IPP_VISIBLE  defined    -  static objects are visible 
*******************************************************************************/

#if defined(_IPP_VISIBLE)
	#define _STCAPI(type, name, arg)  	extern type __STDCALL name arg;
	#define _STCFUN(type, name)         extern type __STDCALL name
#else
	#define _STCAPI(type, name, arg)  	static type name arg;
	#define _STCFUN(type, name)         static type name
#endif

#ifdef __cplusplus
	extern "C" {
#endif

/****************************************************************************
//  Symbol _IPP_DEBUG controls the condition compilation of error checking
//  It switches only macro function _IPP_CHECK_ARG
//  It must be defined through compiler's command line.
*****************************************************************************/

#ifdef	_IPP_DEBUG
	#define	_IPP_CHECK_ARG(expr) \
	{\
		if (!(expr)) {\
			return IPP_STATUS_BAD_ARG;\
		}\
	}
#else
	#define	_IPP_CHECK_ARG(expr)
#endif

#ifndef     NULL
  #ifdef __cplusplus
    #define	NULL			0
  #else
    #define	NULL              ((void *)0)
  #endif
#endif

#undef      TRUE
#define     TRUE               1

#undef      FALSE
#define     FALSE              0


#define     _IPP_SUCCEEDED(status)	(IPP_STATUS_OK == (status))
	
typedef     int                    _IppBool;

#ifdef __cplusplus
	}
#endif

#endif	/* #ifndef ___IPPDEFS_H__ */


/* EOF */

